#pragma once
#include "StdAfx.h"
#include <iostream>
#include <string>
#include <vector>

using namespace std;

struct LrcRecord
{
	int time;
	string lrctxt;
};

class _declspec(dllimport) CLyrics
{
public:
	CLyrics(void);
	~CLyrics(void);

	bool OpenLyric(string filename);								//used to open a lyrics file
	string GetLrctxt(int time);										//get the lyrics
	vector<string> GetLrcHeadInfo();								//get lyrics tag information
	vector<LrcRecord> GetLrcRecord();								//get lyrics
	bool ClearAll();												//clear all the data of this class
	int Getoffset();
private:
	string alllrc;
	FILE* plrcfile;
	int offset;
	vector<LrcRecord> veclrcrec;
	vector<string> veclrcheadinfo;

	bool TestLyricfile(string filename);							//this function used to test whether a *.lrc file is a real lyrics file
	bool LoadLyricfile(string filename);
	bool ReadTimeLabel(int istart, int iend, string& strMi, string& strSec, string& strmSec);
	void StorelineLyrics(int& istart, int& iend);
};

